//
//  InterviewManagementViewController.m
//  CYWFrame
//
//  Created by 于顺燊 on 2018/9/25.
//  Copyright © 2018年 Macx. All rights reserved.
//

#import "InterviewManagementViewController.h"
#import "CCZSegementController2.h"
#import "WaitForConfirmViewController.h"
#import "WaitForInterviewViewController.h"

@interface InterviewManagementViewController ()

@end

@implementation InterviewManagementViewController

- (void)viewDidLoad {
    [super viewDidLoad];
	[self createUI];
    // Do any additional setup after loading the view.
}

- (void)createUI {
	
	self.navigationItem.title = @"面试管理";
	self.view.backgroundColor = kWhiteColor;
	CCZSegementController2 *segment;
	NSInteger role = [GetUserDefaule(USERINFO)[@"role"] integerValue];
	if (role == 2 || role == 4) {
		segment = [CCZSegementController2 segementControllerWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) titles:@[@"待确定",@"待面试",@"已面试",@"已确认"]];
		WaitForConfirmViewController *vc1 = [[WaitForConfirmViewController alloc] init];
		WaitForInterviewViewController *vc2 = [[WaitForInterviewViewController alloc] init];
		WaitForConfirmViewController *vc3 = [[WaitForConfirmViewController alloc] init];
		vc3.type = 1;
		WaitForConfirmViewController *vc4 = [[WaitForConfirmViewController alloc] init];
		vc4.type = 2;
		[segment setViewControllers:@[vc1,vc2,vc3,vc4]];
	}
	else if(role == 5 || role == 6){
		segment = [CCZSegementController2 segementControllerWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) titles:@[@"待确定",@"待面试",@"已面试",@"已确认"]];
		WaitForConfirmViewController *vc1 = [[WaitForConfirmViewController alloc] init];
		WaitForInterviewViewController *vc2 = [[WaitForInterviewViewController alloc] init];
		WaitForConfirmViewController *vc3 = [[WaitForConfirmViewController alloc] init];
		vc3.type = 1;
		WaitForConfirmViewController *vc4 = [[WaitForConfirmViewController alloc] init];
		vc4.type = 2;
		[segment setViewControllers:@[vc1,vc2,vc3,vc4]];
	}
	[segment setSegementTintColor:UIMainColorRGB];
	segment.style = CCZSegementStyleDefault;
	[segment setSelectedItemAtIndex:self.defaultIndex];
	[self.view addSubview:segment.view];
	[self addChildViewController:segment];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
